package com.idbk.chargestation.bean;

import android.os.Parcel;
import android.os.Parcelable;

import com.google.gson.annotations.SerializedName;

public class JsonUser extends JsonBase implements Parcelable {
	
	public final static String KEY = "JsonUser";
	/**
	 * 普通用户
	 * */
	public static final int COMMON_USER = 1;
	/**
	 * 企业号用户
	 * */
	public static final int ENTERPRISE_NUMBER_USER = 2;

	@SerializedName("loginUser") 
	public String loginUser;//登录名
	
	@SerializedName("createdDateTime") 
	public String createdDateTime;

	@SerializedName("realName") 
	public String realName;//真实姓名

	@SerializedName("imageURL") 
	public String imageURL;//头像地址
	
	@SerializedName("cardNo") 
	public String cardNo;//身份证号

	@SerializedName("mobile") 
	public String mobile;//移动电话

	@SerializedName("address") 
	public String address;//用户地址

	@SerializedName("zip") 
	public String zip;//邮编
	
	@SerializedName("balance") 
	public String balance;//剩余金额
	
	@SerializedName("bespeak") 
	public int bespeak;//预约次数
	
	@Deprecated
	@SerializedName("collections") 
	public String collections;//电桩收藏数
	
	@SerializedName("collection4Points") 
	public int collection4Points;//充电点的收藏数目	
	
	@SerializedName("signature") 
	public String signature;//个性签名
	
	@SerializedName("ownerStatus") 
	public int ownerStatus;//是否提交过车主认证信息	
	
	/**
	 * 是否通过了车主认证
	 */
	@SerializedName("isCertified")
	public boolean isCertified;
	
	@SerializedName("clientId")
	public int userId;//用户id

	public JsonUser(){
		
	}
	
	public JsonUser(Parcel source){
		loginUser = source.readString();
		createdDateTime = source.readString();
		
		realName = source.readString();
		imageURL = source.readString();
		cardNo = source.readString();
		mobile = source.readString();
		
		address = source.readString();
		zip = source.readString();
		balance = source.readString();
		bespeak = source.readInt();
		cardNo = source.readString();
		
		collection4Points = source.readInt();
		signature = source.readString();
		ownerStatus = source.readInt();
		
		userId = source.readInt();
	}
	
	@Override
	public int describeContents() {
		// TODO Auto-generated method stub
		return 0;
	}

	@Override
	public void writeToParcel(Parcel dest, int flags) {
		dest.writeString(loginUser);
		dest.writeString(createdDateTime);
		
		dest.writeString(realName);
		dest.writeString(imageURL == null? "":imageURL);
		dest.writeString(cardNo == null? "":cardNo);
		dest.writeString(mobile == null? "":mobile);
		
		dest.writeString(address == null? "":address);
		dest.writeString(zip == null? "":zip);
		dest.writeString(balance == null? "":balance);
		dest.writeInt(bespeak);
		dest.writeString(cardNo == null? "":cardNo);
		
		dest.writeInt(collection4Points);
		dest.writeString(signature == null? "":signature);
		dest.writeInt(ownerStatus);		
		
		dest.writeInt(userId);
	}
	
	 public final static Parcelable.Creator<JsonUser> CREATOR = new Creator<JsonUser>() {
		
		@Override
		public JsonUser[] newArray(int size) {
			// TODO Auto-generated method stub
			return new JsonUser[size];
		}
		
		@Override
		public JsonUser createFromParcel(Parcel source) {
			// TODO Auto-generated method stub
			return new JsonUser(source);
		}
	};

};
